//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef __CDEVICEEVENTDISPATCHER_H__
#define __CDEVICEEVENTDISPATCHER_H__

#include "_CDeviceEventDispatcher.h"

class CDeviceEventDispatcher : public _CDeviceEventDispatcher
{
public:
    CARAPI InvokeEventHandler(
        /* [in] */ const MemoryBuf & ebEventData);

    CARAPI SetEventHandler(
        /* [in] */ Address thisPtr,
        /* [in] */ Address function);

    CDeviceEventDispatcher():
        m_pDelegate(NULL)
    {
    }

    ~CDeviceEventDispatcher()
    {
        if (m_pDelegate)
            delete m_pDelegate;
    }

private:
    EventHandler *m_pDelegate;
};

#endif // __CDEVICEEVENTDISPATCHER_H__
